/*
 * @Author: your name
 * @Date: 2021-04-10 13:40:44
 * @LastEditTime: 2021-04-20 18:13:53
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \chronic-back-end\module\reserveMod\main.go
 */
package reserveMod

import (
	"chronic/module/userMod"

	"github.com/gin-gonic/gin"
)

/*Module 预约模块*/
func Module(app *gin.Engine) {
	module := app.Group("/reserve")
	// 获取某人全部的预约历史记录
	module.GET("/history", userMod.Allow(), getReserveHistory)
	// 上传一条预约记录
	module.POST("/oneReserve", userMod.Allow(userMod.Patient), postOneReserve)
	// 获取某时段下可预约医生的列表
	module.GET("/timeReserve", userMod.Allow(), getTimeReserve)
	// 由医生上传某时段下可预约的名额
	module.POST("/reserveQuota", userMod.Allow(userMod.Doctor, userMod.Admin), postReserveQuota)
	// module.GET("/banReserve", userMod.Allow(), getBanReserve)
	// 获取全部的预约记录
	module.GET("/allReserves", userMod.Allow(userMod.Admin), getAllReserves)
	module.GET("/reservesByUserId", userMod.Allow(userMod.Admin), getReservesByUserId)
	module.GET("/reservesByPatient", userMod.Allow(userMod.Admin), getReservesByPatient)
	module.GET("/reservesByDoctor", userMod.Allow(userMod.Admin), getReservesByDoctor)
	module.DELETE("/admin/reserve", userMod.Allow(userMod.Admin), deleteReserve)
}
